Codes and data
This folder contains the data and codes used in the paper "Reading between the Lines – Uncovering Asymmetry in the Central Bank Loss Function"
by Markus Haavio, Joni Heikkinen, Pirkka Jalasjoki, Juha Kilponen, Maritta Paloviita, and Ilona Vänni.

Folder contents

1. Codes.zip
This archive contains the data and text‑analysis codes used to produce the empirical results, figures, and tables in the paper (excluding Section 4 simulations).

Main contents of Codes.zip:
- estimation_data/ => Data used in the estimation of loss functions.
- language_models/ => Scripts and outputs for FinBERT, Central Bank RoBERTa and GPT-4.
- latex_tables_and_figures/ => Output tables and figures generated by the codes.
- modified_LM_dictionary/ => Modifications to the Loughran–McDonald (2011) sentiment dictionary.
- R_libraries/ => Documented R libraries used in the analysis.
- rules/ => Bigram and trigram rules.
- tone/ => Constructed tone indices from ECB introductory statements.


Main R scripts (Rmd files):

1. Lexicon-based_whole_text_tone.Rmd => Lexicon‑based sentiment tone using whole introductory statements.
2. Topic_model_and_Figure_2.Rmd => Topic modelling (LDA) and construction of Figure 2.
3. Lexicon-based_inflation_text_tone.Rmd => Lexicon‑based sentiment tone using inflation‑related text segments.
4. Figure_1_and_3.Rmd => Construction of Figure 1 and Figure 3.
5. Text_data_to_language_models.Rmd => Preparation of text data for language‑model analysis.
6. Language_model_tone_indices.Rmd => Construction of tone indices using language models (FinBERT, RoBERTa).
7. Time_dimensions_GPT-4.Rmd => Classification of text into forward‑looking and backward‑looking components.
8. Figures_4–7_and_selected_Appendix_figures.Rmd => Generation of Figures 4-7 and selected appendix figures.
9. Loss_function_estimations.Rmd => Estimation of piecewise linear and linex loss functions.


Data files included:

- default_loughran.xlsx – Original Loughran–McDonald dictionary
- figure_dataset.xlsx – Dataset used for figures created in Figures_4–7_and_selected_Appendix_figures.Rmd
- inflation_data.xlsx – Real‑time inflation data
- inflation_texts.xlsx – Inflation‑related text segments
- intro.csv – ECB introductory statements dataset



2. Matlab_codes.zip
This archive contains MATLAB codes used for:

- Section 4 (optimal monetary policy simulations in a canonical New Keynesian model)
- Online Appendix H

The MATLAB codes generate impulse responses and simulation figures illustrating the implications of asymmetric loss functions.






